/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package digitaldreamers.games.ddmonsters.servers.gameserver.components.basicinfomation;

/**
 * This class presents a card.
 * @author Admin
 */
public class CardInformation
{
    // <editor-fold defaultstate="collapsed" desc="Constants">
    
    // <editor-fold defaultstate="collapsed" desc="Database column names">
    public static final String CARD_ID_COLUMN = "monster_id";
    public static final String CARD_NAME_COLUMN = "monster_name";
    public static final String CARD_DESCRIPTION_COLUMN = "description";
    public static final String CARD_PRICE_COLUMN = "price";
    // </editor-fold>
    
    private static final float SHOP_SALE_RATE = 0.5f;//The sale rate constant to calculate price when the player sells a card to shop.
    
    // </editor-fold>
    
    private int m_iCardID;//The ID of the card.
    private String m_strCardName;//The name of the card.
    private String m_strCardDescription;//The information of the card.
    private int m_iCardPrice;//The price of the card.
    private boolean m_bCardType;//The type of the card (monster card or spell card).
    
    /**
     * Get the ID of the card.
     * @return The ID of the card.
     */
    public int getCardID() {
        return m_iCardID;
    }
    
    public void setCardID(int iCardID) {
        m_iCardID = iCardID;
    }
    
    /**
     * Get the name of the card.
     * @return The name of the card.
     */
    public String getCardName() {
        return m_strCardName;
    }
    
    public void setCardName(String strCardName) {
        m_strCardName = strCardName;
    }
    
    /**
     * Get the card description.
     * @return The card description.
     */
    public String getCardDescription() {
        return m_strCardDescription;
    }
    
    public void setCardDescription(String strDescription) {
        m_strCardDescription = strDescription;
    }
    
    /**
     * Get the price of the card.
     * @return The price of the card.
     */
    public int getCardPrice() {
        return m_iCardPrice;
    }
    
    public void setCardPrice(int iCardPrice) {
        m_iCardPrice = iCardPrice;
    }
    
    /**
     * Get the type of the card.
     * @return The type of the card. True if monster card, false if magic card.
     */
    public boolean getCardType() {
        return m_bCardType;
    }
    
    /**
     * Get the shop sale price.
     * @return The shop sale price.
     */
    public int getSalePrice() {
        return (int) (m_iCardPrice * SHOP_SALE_RATE);
    }
    
    public CardInformation() {
        this(-1, "", "", 0, true);
    }
    
    /**
     * Create a new instance of a card.
     * @param iMonsterID The ID of the card.
     * @param strCardName The name of the card.
     * @param strDescription The information of the card.
     * @param iPrice The price of the card.
     * @param bCardType The type of the card (monster card or spell card).
     */
    public CardInformation(int iCardID, String strCardName, String strCardDescription, int iCardPrice, boolean bCardType) {
        m_iCardID = iCardID;
        m_strCardName = strCardName;
        m_strCardDescription = strCardDescription;
        m_iCardPrice = iCardPrice;
        m_bCardType = bCardType;
    }
}
